import {build, defineConfig} from "vite"
import { resolve } from 'path'
import pugPlugin from "vite-plugin-pug"
import {sites} from './sites.js'

const options = {pretty: true} // FIXME: pug pretty is deprecated!

locals = {
    sites
}

export default defineConfig(({ command, mode }) => {

    return {
        // dev specific config
        plugins: [pugPlugin(options, locals)],
        build: {
            outDir: "dist",
            emptyOutDir:true
        },
        base : mode == 'production' ?  ''  :'/',
        publicDir: 'static'
    }

})

